package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.NewsCasesMapper;
import com.ruoyi.system.domain.NewsCases;
import com.ruoyi.system.service.INewsCasesService;

/**
 * 案例信息Service业务层处理
 * 
 * @author shan
 * @date 2025-02-28
 */
@Service
public class NewsCasesServiceImpl implements INewsCasesService 
{
    @Autowired
    private NewsCasesMapper newsCasesMapper;

    /**
     * 查询案例信息
     * 
     * @param id 案例信息主键
     * @return 案例信息
     */
    @Override
    public NewsCases selectNewsCasesById(Long id)
    {
        return newsCasesMapper.selectNewsCasesById(id);
    }

    /**
     * 查询案例信息列表
     * 
     * @param newsCases 案例信息
     * @return 案例信息
     */
    @Override
    public List<NewsCases> selectNewsCasesList(NewsCases newsCases)
    {
        return newsCasesMapper.selectNewsCasesList(newsCases);
    }

    /**
     * 新增案例信息
     * 
     * @param newsCases 案例信息
     * @return 结果
     */
    @Override
    public int insertNewsCases(NewsCases newsCases)
    {
        newsCases.setCreateTime(DateUtils.getNowDate());
        return newsCasesMapper.insertNewsCases(newsCases);
    }

    /**
     * 修改案例信息
     * 
     * @param newsCases 案例信息
     * @return 结果
     */
    @Override
    public int updateNewsCases(NewsCases newsCases)
    {
        return newsCasesMapper.updateNewsCases(newsCases);
    }

    /**
     * 批量删除案例信息
     * 
     * @param ids 需要删除的案例信息主键
     * @return 结果
     */
    @Override
    public int deleteNewsCasesByIds(Long[] ids)
    {
        return newsCasesMapper.deleteNewsCasesByIds(ids);
    }

    /**
     * 删除案例信息信息
     * 
     * @param id 案例信息主键
     * @return 结果
     */
    @Override
    public int deleteNewsCasesById(Long id)
    {
        return newsCasesMapper.deleteNewsCasesById(id);
    }
}
